import request from '@/utils/request'
// 获取文章评论列表
export const getComments = function (params) {
  return request({
    method: 'GET',
    url: '/v1_0/comments',
    params
  })
}
// 评论点赞
export const addCommentLike = function (target) {
  return request({
    method: 'POST',
    url: '/v1_0/comment/likings',
    data: {
      target
    }
  })
}
// 评论取消点赞
export const deleteCommentLike = function (target) {
  return request({
    method: 'DELETE',
    url: `/v1_0/comment/likings/${target}`
  })
}
// 发布评论或回复
export const addComment = function (data) {
  return request({
    method: 'POST',
    url: '/v1_0/comments',
    data
  })
}
